package com.app.model;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.sql.Timestamp;

@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("lm_goods")
@JsonInclude(JsonInclude.Include.NON_NULL)
public class GoodsModel {
    @TableId(value="id",type= IdType.AUTO)
    private Integer id;
    private Integer villageId;
    @TableField(exist = false)
    private String villageText;
    private String name;//标题
    private String description;//描述
    private String content;//内容
    private String coverImage;//封面图片
    private String swiperImage;//商品详情轮播图url
    private Integer inventory;//库存
    @TableField(exist = false)
    private Integer handleInventory;//处理后库存
    @TableField(exist = false)
    private Integer handleIntegral;//处理后积分
    private Integer integral;//积分
    private Integer type;//分类
    private Integer states;//分类
    @TableField(exist = false)
    private String typeText;//分类
    private Integer status;//1正常 2下架
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") //后端注解格式化日期
    private Timestamp createTime;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") //后端注解格式化日期
    private Timestamp updateTime;
    @TableField(exist = false)
    private String[] swiperImageArr;
}
